<?php

namespace Rebuild\Server;

use Rebuild\Config\Config;

class ServerFactory
{
    protected $server;
    protected $serverConfig;

    public function configure(array $configs)
    {
        $this->serverConfig = $configs;

        $this->getServer()->init($this->serverConfig);
    }

    public function getServer()
    {
        if (!$this->server instanceof ServerInterface) {
            $this->server = new Server();
        }
        return $this->server;
    }

}